<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Android,反编译,安全,浏览器," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="设置默认浏览器是浏览器类软件的基本功能之一，通过设置默认浏览器，提高用户主动打开自家产品的机会。但是由于国内不同Rom差异很大，想要把这个功能做好，却也不易。本文主要分享，如何通过竞品分析的角度，解决我们在开发过程中遇到的问题。  设置默认浏览器设置默认浏览器的主要有两大流派，分别是官方提供法和越轨提权法 UC浏览器提供的那种思路，没有尝试，主要觉得对权限要求太高，兼容性无法保障，需要对容错有很">
<meta name="keywords" content="Android,反编译,安全,浏览器">
<meta property="og:type" content="article">
<meta property="og:title" content="Android反编译－揭秘猎豹设置默认浏览器逻辑">
<meta property="og:url" content="http://imesong.com/2016/04/05/2016/Android反编译实战－揭秘猎豹设置默认浏览器实现逻辑/index.html">
<meta property="og:site_name" content="imesong">
<meta property="og:description" content="设置默认浏览器是浏览器类软件的基本功能之一，通过设置默认浏览器，提高用户主动打开自家产品的机会。但是由于国内不同Rom差异很大，想要把这个功能做好，却也不易。本文主要分享，如何通过竞品分析的角度，解决我们在开发过程中遇到的问题。  设置默认浏览器设置默认浏览器的主要有两大流派，分别是官方提供法和越轨提权法 UC浏览器提供的那种思路，没有尝试，主要觉得对权限要求太高，兼容性无法保障，需要对容错有很">
<meta property="og:image" content="http://7xrkqt.com1.z0.glb.clouddn.com/%E8%AE%BE%E7%BD%AE%E9%BB%98%E8%AE%A4%E6%B5%8F%E8%A7%88%E5%99%A8%E6%B5%81%E7%A8%8B.png">
<meta property="og:updated_time" content="2017-04-19T04:36:26.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Android反编译－揭秘猎豹设置默认浏览器逻辑">
<meta name="twitter:description" content="设置默认浏览器是浏览器类软件的基本功能之一，通过设置默认浏览器，提高用户主动打开自家产品的机会。但是由于国内不同Rom差异很大，想要把这个功能做好，却也不易。本文主要分享，如何通过竞品分析的角度，解决我们在开发过程中遇到的问题。  设置默认浏览器设置默认浏览器的主要有两大流派，分别是官方提供法和越轨提权法 UC浏览器提供的那种思路，没有尝试，主要觉得对权限要求太高，兼容性无法保障，需要对容错有很">
<meta name="twitter:image" content="http://7xrkqt.com1.z0.glb.clouddn.com/%E8%AE%BE%E7%BD%AE%E9%BB%98%E8%AE%A4%E6%B5%8F%E8%A7%88%E5%99%A8%E6%B5%81%E7%A8%8B.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://imesong.com/2016/04/05/2016/Android反编译实战－揭秘猎豹设置默认浏览器实现逻辑/"/>





  <title> Android反编译－揭秘猎豹设置默认浏览器逻辑 | imesong </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?cb36183ed65a7652b909d352ab2166";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">imesong</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">我们的征途是星辰大海</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://imesong.com/2016/04/05/2016/Android反编译实战－揭秘猎豹设置默认浏览器实现逻辑/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="imesong">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://s.gravatar.com/avatar/bd2525e0ecc6d8022339c7dce27065c0?s=160">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="imesong">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Android反编译－揭秘猎豹设置默认浏览器逻辑
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2016-04-05T17:41:05+08:00">
                2016-04-05
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Android/" itemprop="url" rel="index">
                    <span itemprop="name">Android</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body han-init-context" itemprop="articleBody">

      
      

      
        <blockquote>
<p>设置默认浏览器是浏览器类软件的基本功能之一，通过设置默认浏览器，提高用户主动打开自家产品的机会。但是由于国内不同Rom差异很大，想要把这个功能做好，却也不易。本文主要分享，如何通过竞品分析的角度，解决我们在开发过程中遇到的问题。</p>
</blockquote>
<h3 id="设置默认浏览器"><a href="#设置默认浏览器" class="headerlink" title="设置默认浏览器"></a>设置默认浏览器</h3><p>设置默认浏览器的主要有两大流派，分别是<strong><a href="http://blog.csdn.net/ifangler/article/details/39549319" target="_blank" rel="external">官方提供法</a></strong>和<strong><a href="http://blog.csdn.net/leilu2008/article/details/8774112" target="_blank" rel="external">越轨提权法</a></strong></p>
<p>UC浏览器提供的那种思路，没有尝试，主要觉得对权限要求太高，兼容性无法保障，需要对容错有很多考虑。官方提供的方法中，原生Rom是没有问题的，但是通过测试发现，现在的主流设备上，华为，三星，小米，乐视个别型号上都无法设置成功。通过分析竞品，QQ，UC，猎豹都可以设置成功。这个就引起了我的好奇，他们是如何做到的，这里主要探索猎豹浏览器的做法。</p>
<a id="more"></a>
<h3 id="设置默认浏览器流程"><a href="#设置默认浏览器流程" class="headerlink" title="设置默认浏览器流程"></a>设置默认浏览器流程</h3><p>我们先来看下设置默认浏览器的流程图</p>
<p><img src="http://7xrkqt.com1.z0.glb.clouddn.com/%E8%AE%BE%E7%BD%AE%E9%BB%98%E8%AE%A4%E6%B5%8F%E8%A7%88%E5%99%A8%E6%B5%81%E7%A8%8B.png" alt="设置默认浏览器流程图"></p>
<p>在上面提到的两篇文章中，也都是这个思路。关键点有三个。</p>
<h3 id="判断是否有默认浏览器"><a href="#判断是否有默认浏览器" class="headerlink" title="判断是否有默认浏览器"></a>判断是否有默认浏览器</h3><p>我们看猎豹，如果有设置默认浏览器，他会使用一个ListView，把所有的默认浏览器的列出来。我们只需要找到初始化ListView的 Adapter，就可以拿到对应的方法。<br><strong>SettingDefaultActivity 的 onResume 方法，我们定位到 ah.d(this);</strong><br>我们看下具体的代码，虽然被混淆了，逻辑还是能够清晰的看到。简单还原下，这段代码就可以使用。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div></pre></td><td class="code"><pre><div class="line">public static ArrayList d(Context paramContext)</div><div class="line">  &#123;</div><div class="line">    ArrayList localArrayList1 = new ArrayList();</div><div class="line">    PackageManager localPackageManager = paramContext.getPackageManager();</div><div class="line">    Intent localIntent = new Intent(&quot;android.intent.action.VIEW&quot;);</div><div class="line">    localIntent.addCategory(&quot;android.intent.category.BROWSABLE&quot;);</div><div class="line">    localIntent.setData(Uri.parse(&quot;http://bbs.liebao.cn&quot;));</div><div class="line">    try</div><div class="line">    &#123;</div><div class="line">      List localList2 = localPackageManager.queryIntentActivities(localIntent, 0);</div><div class="line">      localList1 = localList2;</div><div class="line">      if (localList1 != null)</div><div class="line">      &#123;</div><div class="line">        ArrayList localArrayList2 = new ArrayList();</div><div class="line">        ArrayList localArrayList3 = new ArrayList();</div><div class="line">        Iterator localIterator1 = localList1.iterator();</div><div class="line">        while (localIterator1.hasNext())</div><div class="line">        &#123;</div><div class="line">          ResolveInfo localResolveInfo = (ResolveInfo)localIterator1.next();</div><div class="line">          localPackageManager.getPreferredActivities(localArrayList3, localArrayList2, localResolveInfo.activityInfo.packageName);</div><div class="line">          Iterator localIterator2 = localArrayList3.iterator();</div><div class="line">          while (localIterator2.hasNext())</div><div class="line">          &#123;</div><div class="line">            IntentFilter localIntentFilter = (IntentFilter)localIterator2.next();</div><div class="line">            if (((!localIntentFilter.hasCategory(&quot;android.intent.category.BROWSABLE&quot;)) &amp;&amp; (!localIntentFilter.hasCategory(&quot;android.intent.category.DEFAULT&quot;))) || (!localIntentFilter.hasDataScheme(&quot;http&quot;)))</div><div class="line">              continue;</div><div class="line">            localArrayList1.add(localResolveInfo);</div><div class="line">          &#125;</div><div class="line">        &#125;</div><div class="line">      &#125;</div><div class="line">    &#125;</div><div class="line">    catch (Exception localException)</div><div class="line">    &#123;</div><div class="line">      while (true)</div><div class="line">      &#123;</div><div class="line">        String str = a;</div><div class="line">        Object[] arrayOfObject = new Object[1];</div><div class="line">        arrayOfObject[0] = localException.getMessage();</div><div class="line">        ae.d(str, &quot;queryIntentActivities Exception: %s&quot;, arrayOfObject);</div><div class="line">        List localList1 = null;</div><div class="line">      &#125;</div><div class="line">    &#125;</div><div class="line">    return localArrayList1;</div><div class="line">  &#125;</div></pre></td></tr></table></figure>
<p>上面的这段代码返回了当前手机上设置的默认浏览器。如果为空，证明没有设置默认浏览器，如果不为空，已经把对应的包名，还有其他的信息都已经保存起来了。</p>
<h3 id="获取默认浏览器的包名"><a href="#获取默认浏览器的包名" class="headerlink" title="获取默认浏览器的包名"></a>获取默认浏览器的包名</h3><p>由于我们已经保存了所有的默认浏览器数据，遍历里面的数据就可以拿到默认浏览器的包名</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line">/**</div><div class="line">* 找到默认浏览器对应的包名</div><div class="line">* 有可能会设置多个浏览器为默认浏览器，这里只考虑其中一个</div><div class="line">*/</div><div class="line">public static String findPackageNameOfDefaultBrowser(Context context) &#123;</div><div class="line">   Iterator iterator = getDefaultBrowserList(context).iterator();</div><div class="line">   if (iterator.hasNext()) &#123;</div><div class="line">        ResolveInfo resolveInfo = (ResolveInfo) iterator.next();</div><div class="line">        return resolveInfo != null ? resolveInfo.activityInfo.packageName : &quot;&quot;;</div><div class="line">    &#125;</div><div class="line">    return &quot;&quot;;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="清除默认浏览器"><a href="#清除默认浏览器" class="headerlink" title="清除默认浏览器"></a>清除默认浏览器</h3><p>在<strong>SettingDefaultBrowserActivity</strong> 中 ，有个onClick 事件，是 清除按钮的响应事件，找到下面的代码</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">/**</div><div class="line"> * 启动packageName对应的App的清除默认浏览器设置界面</div><div class="line"> */</div><div class="line">public static void startAppInfoForPackageName(Activity activity, String packageName, int requestCode) &#123;</div><div class="line">    Intent intent = new Intent();</div><div class="line">    intent.setAction(&quot;android.settings.APPLICATION_DETAILS_SETTINGS&quot;);</div><div class="line">    intent.setData(Uri.fromParts(&quot;package&quot;, packageName, null));</div><div class="line">    activity.startActivityForResult(intent, requestCode);</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>可以看到这里是发送一个Intent ,请求清除默认浏览器设置的页面。</p>
<h3 id="设置默认浏览器-1"><a href="#设置默认浏览器-1" class="headerlink" title="设置默认浏览器"></a>设置默认浏览器</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line">/**</div><div class="line"> * 通知系统设置默认浏览器请求</div><div class="line"> */</div><div class="line">public static void sendSetDefaultBrowserRequestIntent(Context context) &#123;</div><div class="line">    try &#123;</div><div class="line">        Intent localIntent = new Intent();</div><div class="line">        localIntent.setAction(&quot;android.intent.action.VIEW&quot;);</div><div class="line">        localIntent.putExtra(&quot;set_browser_congratulation&quot;, &quot;set_browser_congratulation&quot;);</div><div class="line">        localIntent.addCategory(&quot;android.intent.category.DEFAULT&quot;);</div><div class="line">        localIntent.setData(Uri.parse(LANDING_URL));</div><div class="line">        localIntent.setComponent(new ComponentName(&quot;android&quot;, &quot;com.android.internal.app.ResolverActivity&quot;));</div><div class="line">        context.startActivity(localIntent);</div><div class="line">    &#125; catch (Exception e) &#123;</div><div class="line">       e.printException();</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p><strong>根据这个思路，我们基本上解决了设置默认浏览器的几个关键问题。经过测试，在主流设备上都没有问题。效果和QQ，UC，猎豹达到了同样的效果。</strong></p>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><p><a href="http://blog.csdn.net/shichaosong/article/details/10364173" target="_blank" rel="external">提升权限相关方法</a></p>
<p><a href="http://blog.csdn.net/ifangler/article/details/39549319" target="_blank" rel="external">通用的设置默认浏览器方法</a></p>
<p><a href="http://droidyue.com/blog/2014/07/13/set-preferred-application-in-android-chinese-edition/index.html" target="_blank" rel="external">设置默认应用程序原理</a></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Android/" rel="tag"># Android</a>
          
            <a href="/tags/反编译/" rel="tag"># 反编译</a>
          
            <a href="/tags/安全/" rel="tag"># 安全</a>
          
            <a href="/tags/浏览器/" rel="tag"># 浏览器</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/04/07/2016/Android-Smali-语法学习/" rel="next" title="Android Smali 语法学习">
                <i class="fa fa-chevron-left"></i> Android Smali 语法学习
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/04/05/2016/Android-在线换肤方案总结分享/" rel="prev" title="Android 在线换肤方案总结分享">
                Android 在线换肤方案总结分享 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="https://s.gravatar.com/avatar/bd2525e0ecc6d8022339c7dce27065c0?s=160"
               alt="imesong" />
          <p class="site-author-name" itemprop="name">imesong</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">10</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">5</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">20</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/imesong" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#设置默认浏览器"><span class="nav-number">1.</span> <span class="nav-text">设置默认浏览器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置默认浏览器流程"><span class="nav-number">2.</span> <span class="nav-text">设置默认浏览器流程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#判断是否有默认浏览器"><span class="nav-number">3.</span> <span class="nav-text">判断是否有默认浏览器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#获取默认浏览器的包名"><span class="nav-number">4.</span> <span class="nav-text">获取默认浏览器的包名</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#清除默认浏览器"><span class="nav-number">5.</span> <span class="nav-text">清除默认浏览器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置默认浏览器-1"><span class="nav-number">6.</span> <span class="nav-text">设置默认浏览器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考资料"><span class="nav-number">7.</span> <span class="nav-text">参考资料</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">imesong</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.0"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  


  




	





  





  





  






  





  

  

  

  

  

</body>
</html>
